package com.fansaikj.erp.domain;

/*
 * Copyright © 2020-2035 erupt.xyz All rights reserved.
 * Author: YuePeng (erupts@126.com)
 */

import javax.persistence.*;

import lombok.Data;
import lombok.EqualsAndHashCode;
import xyz.erupt.annotation.*;
import xyz.erupt.annotation.sub_erupt.Power;
import xyz.erupt.annotation.sub_field.*;
import xyz.erupt.annotation.sub_field.sub_edit.*;
import xyz.erupt.jpa.model.BaseModel;

import java.util.Date;

@EqualsAndHashCode(callSuper = true)
@Erupt(
        name = "费用设置",
        power = @Power(add = true, delete = true,
                edit = true, query = true, viewDetails = true,
                importable = true, export = true)
)
@Table(name = "erp_setting_charge")
@Entity
@Data
public class SettingCharge extends BaseModel {

    @EruptField(
            views = @View(
                    title = "主键ID", show = false
            ),
            edit = @Edit(
                    title = "主键ID",
                    type = EditType.INPUT, show = false, notNull = true,
                    inputType = @InputType
            )
    )
    private Long id;

    @EruptField(
            views = @View(
                    title = "费用名称"
            ),
            edit = @Edit(
                    title = "费用名称",
                    type = EditType.INPUT, notNull = true,
                    search = @Search,
                    inputType = @InputType
            )
    )
    private String chargeName;

    @EruptField(
            views = @View(
                    title = "费用类型"
            ),
            edit = @Edit(
                    title = "费用类型",
                    type = EditType.CHOICE, notNull = true,
                    search = @Search,
                    choiceType = @ChoiceType(
                            vl = {
                                    @VL(value = "1", label = "销售往来"),
                                    @VL(value = "2", label = "备用金往来"),
                                    @VL(value = "3", label = "管理费用"),
                                    @VL(value = "4", label = "财务费用"),
                                    @VL(value = "5", label = "其他应付"),
                                    @VL(value = "6", label = "其他应收"),
                                    @VL(value = "7", label = "销售费用"),
                                    @VL(value = "8", label = "营业外收益"),
                                    @VL(value = "9", label = "税金及附加"),
                                    @VL(value = "10", label = "刷卡退款"),
                                    @VL(value = "11", label = "刷卡收入"),
                            }
                    )
            )
    )
    private String chargeType;

    @EruptField(
            views = @View(
                    title = "收支方向"
            ),
            edit = @Edit(
                    title = "收支方向",
                    type = EditType.CHOICE, notNull = true,
                    search = @Search,
                    choiceType = @ChoiceType(
                            vl = {
                                    @VL(value = "1", label = "收入"),
                                    @VL(value = "2", label = "支出"),
                            }
                    )
            )
    )
    private String paymentDirectionType;

    @EruptField(
            views = @View(
                    title = "是否关联运费"
            ),
            edit = @Edit(
                    title = "是否关联运费",
                    type = EditType.CHOICE,
                    choiceType = @ChoiceType(
                            vl = {
                                    @VL(value = "Y", label = "是"),
                                    @VL(value = "N", label = "否"),
                            }
                    )
            )
    )
    private String isTransCharge;

    @EruptField(
            views = @View(
                    title = "创建人", show = false
            ),
            edit = @Edit(
                    title = "创建人",
                    type = EditType.INPUT, show = false,
                    inputType = @InputType
            )
    )
    private String createBy;

    @EruptField(
            views = @View(
                    title = "创建时间", show = false
            ),
            edit = @Edit(
                    title = "创建时间",
                    type = EditType.DATE, show = false,
                    dateType = @DateType
            )
    )
    private Date createTime;

    @EruptField(
            views = @View(
                    title = "修改人", show = false
            ),
            edit = @Edit(
                    title = "修改人",
                    type = EditType.INPUT, show = false,
                    inputType = @InputType
            )
    )
    private String updateBy;

    @EruptField(
            views = @View(
                    title = "修改时间", show = false
            ),
            edit = @Edit(
                    title = "修改时间",
                    type = EditType.DATE, show = false,
                    dateType = @DateType
            )
    )
    private Date updateTime;

    @EruptField(
            views = @View(
                    title = "备注"
            ),
            edit = @Edit(
                    title = "备注",
                    type = EditType.TEXTAREA
            )
    )
    private String remark;

    @EruptField(
            views = @View(
                    title = "删除状态(0-正常,1-已删除)", show = false
            ),
            edit = @Edit(
                    title = "删除状态(0-正常,1-已删除)",
                    type = EditType.INPUT, show = false,
                    inputType = @InputType
            )
    )
    private String delFlag;

}
